﻿namespace OpalisConsole
{
    using System.Windows.Controls;
    using System.Windows.Navigation;

    /// <summary>
    /// Home page for the application.
    /// </summary>
    public partial class Home : Page
    {
        /// <summary>
        /// Creates a new <see cref="Home"/> instance.
        /// </summary>
        public Home()
        {
            InitializeComponent();
            this.Title = ApplicationStrings.HomePageTitle;
        }

        /// <summary>
        /// Executes when the user navigates to this page.
        /// </summary>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            switch(App.Current.Resources["Status"].ToString())
            {
                case "Not Owner":
                    this.NavigationService.Navigate(new System.Uri("/User_Imaging/Unauthorized", System.UriKind.Relative));
                    break;
                case "Not Approved":
                    this.NavigationService.Navigate(new System.Uri("/User_Imaging/Registration", System.UriKind.Relative));
                    break;
                case "Not Scheduled":
                    this.NavigationService.Navigate(new System.Uri("/User_Imaging/LandingPage", System.UriKind.Relative));
                    break;
                default:
                    this.NavigationService.Navigate(new System.Uri("/User_Imaging/Summary", System.UriKind.Relative));
                    break;
            }
        }
    }
}